import requests

def download_hwt_file():
    url = "https://contentcenter-drcn.dbankcdn.cn/vvt_1/HW-Themes_ThemeContentFile/hitop/theme/703443083/58880990B68B8E0DE1707BC2CF867890.hwt"
    headers = {
        "Host": "contentcenter-drcn.dbankcdn.cn",
        "Connection": "keep-alive",
        # "Content-Length": "3106",
        "User-Agent": "Mozilla/5.0 (Linux; Android 13; M2012K11AC Build/TKQ1.221114.001) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36",
        "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
        "Accept": "*/*",
        # "Origin": "https://h5hosting-drcn.dbankcdn.cn",
        "X-Requested-With": "mark.via",
        "Sec-Fetch-Site": "cross-site",
        "Sec-Fetch-Mode": "no-cors",
        "Sec-Fetch-Dest": "empty",
        # "Referer": "https://h5hosting-drcn.dbankcdn.cn/",
        "Accept-Encoding": "gzip, deflate, br",
        "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7"
    }
    
    try:
        response = requests.get(url, headers=headers)
        response.raise_for_status()
        
        with open("downloaded_file.hwt", "wb") as file:
            file.write(response.content)
        
        print("文件下载成功")
    except requests.exceptions.RequestException as e:
        print("文件下载失败，错误信息：", e)

download_hwt_file()
